/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model.universityUnits;

import model.Constants;
import model.entitys.NamedEntity;

/**
 *
 * @author Dmitri Paziy
 */
public class Faculty extends NamedEntity<Department> implements FacultyInterface{
    private Deanery deanery;
    private Curriculum curriculum;

    public Faculty(String name) {
        super(name);
    }

    @Override
    public Curriculum getCurriculum() {
        return curriculum;
    }

    public void setCurriculum(Curriculum curriculum) {
        this.curriculum = curriculum;
    }

    public Deanery getDeanery() {
        return deanery;
    }

    public void setDeanery(Deanery deanery) {
        this.deanery = deanery;
    }
    
    @Override
    public Deanery getDeneary() {
        return deanery;
    }
    
    private String printObject(Object obj) {
        if (obj != null) {
            return obj.toString();
        } else {
            return " - ";
        }
    }
    

    @Override
    public String toString() {
        final StringBuilder builder = new StringBuilder();
        
        builder.append("Faculty: ");
        builder.append(getName());
        builder.append(Constants.LINE_SEPARATOR);
        builder.append("\tDeanery: ");
        builder.append(printObject(deanery));
        builder.append(Constants.LINE_SEPARATOR);
        builder.append("\tCurriculum: ");
        builder.append(printObject(curriculum));
        builder.append(Constants.LINE_SEPARATOR);
        
        return builder.toString();
    }
}
